////////////////////////////////////////////////////////////////////////////////////////
// Stauffer Public Perceptions of Women's Inclusion and Feelings of Political Efficacy
// Replication Code - Appendix 6
///////////////////////////////////////////////////////////////////////////////////////

***********
// TABLE A5
***********

*set working directory 
use 1618_CCES.dta, clear

*55
///Ad
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg i.year if r_estimate<=55 || state:, cov(uns)

estimates store alt_55a

///Int
xtmixed efficacy_1 c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
i.year if r_estimate<=55 || state: , cov(uns)

estimates store alt_55b

*50
///Ad
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg ///
i.year if r_estimate<=50 || state:, cov(uns)

estimates store alt_50a

///Int
xtmixed efficacy_1 c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
i.year if r_estimate<=50|| state:, cov(uns)

estimates store alt_50b


*45
///Ad
xtmixed efficacy_1 c.r_estimate gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen woman_rep c.stateleg ///
i.year if r_estimate<=45 || state:, cov(uns)

estimates store alt_45a

///Int
xtmixed efficacy_1 c.r_estimate##gender_r c.ideo7 i.party strong_partisan know_fed religiosity ///
coll white c.age##c.age employed woman_sen##gender_r woman_rep##gender_r c.stateleg##gender_r ///
i.year if r_estimate<=45 || state:, cov(uns)
estimates store alt_45b 

*Generate Latex Code For Table
estout alt_55a alt_55b alt_50a alt_50b alt_45a alt_45b, cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)


***********
// TABLE A6
***********

use 17_CCES.dta, clear 

*55
meoprobit state_responsive c.state c.state_guess gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=55 ||StateAbbr:, cov(uns)

estimates store state_ad55

meoprobit state_responsive c.state##gender_r c.state_guess##gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=55 ||StateAbbr:, cov(uns) 

estimates store state_int55

*50
meoprobit state_responsive c.state c.state_guess gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=50 ||StateAbbr: , cov(uns)

estimates store state_ad50

meoprobit state_responsive c.state##gender_r c.state_guess##gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=50 ||StateAbbr: , cov(uns)

estimates store state_int50

*45
meoprobit state_responsive c.state c.state_guess gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=45 ||StateAbbr: , cov(uns)

estimates store state_ad45

meoprobit state_responsive c.state##gender_r c.state_guess##gender_r c.ideo7##c.state_ideo01 congruence i.party strong_partisan know_state ///
c.age##c.age white coll employed religiosity if state_guess<=45 ||StateAbbr: , cov(uns)

estimates store state_int45

*Generate Latex Code For Table
estout state_ad55 state_int55 state_ad50 state_int50 state_ad45 state_int45 , cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)


***********
// TABLE A7
***********

use 18_panel.dta, clear

*55
reg eff_diff r_diff if r_estimate<=55, robust 
estimates store mod1 

reg eff_diff c.r_diff##i.gender_r if r_estimate<=55, robust 
estimates store mod2 

reg eff_diff c.r_diff rep_diff sen_diff state_diff if r_estimate<=55, robust
estimates store mod3

reg eff_diff c.r_diff##i.gender_r rep_diff rep_int sen_diff sen_int c.state_diff##i.gender_r if r_estimate<=55, robust
estimates store mod4

*50
reg eff_diff r_diff if r_estimate<=50, robust 
estimates store mod1b

reg eff_diff c.r_diff##i.gender_r if r_estimate<=50, robust 
estimates store mod2b

reg eff_diff c.r_diff rep_diff sen_diff state_diff if r_estimate<=50, robust
estimates store mod3b

reg eff_diff c.r_diff##i.gender_r rep_diff rep_int sen_diff sen_int c.state_diff##i.gender_r if r_estimate<=50, robust
estimates store mod4b

*45
reg eff_diff r_diff if r_estimate<=45, robust 
estimates store mod1c

reg eff_diff c.r_diff##i.gender_r if r_estimate<=45, robust 
estimates store mod2c

reg eff_diff c.r_diff rep_diff sen_diff state_diff if r_estimate<=45, robust
estimates store mod3c

reg eff_diff c.r_diff##i.gender_r rep_diff rep_int sen_diff sen_int c.state_diff##i.gender_r if r_estimate<=45, robust
estimates store mod4c

*Generate code for Latex table
estout mod1 mod2 mod3 mod4 mod1b mod2b mod3b mod4b mod1c mod2c mod3c mod4c  , cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)
